package net.ibizsys.eclipse.studio.console;

import net.ibizsys.eclipse.studio.Activator;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

/**
 * 日志对象
 * 
 * @author <a href='http://www.weibo.com/xjtoo' target='_blank'>Enmaai</a>
 */
public class Logger
{
	public static final int INFO = IStatus.INFO;
	public static final int WARNING = IStatus.WARNING;
	public static final int ERROR = IStatus.ERROR;
	public static final int OK = IStatus.OK;
	public static final int CANCEL = IStatus.CANCEL;

	/**
	 * 记录日志
	 * 
	 * @param level
	 * @param message
	 */
	public static void log(String message)
	{
		log(ERROR, message);
	}

	/**
	 * 记录日志
	 * 
	 * @param level
	 * @param message
	 */
	public static void log(int level, String message)
	{
		Activator.getDefault().getLog().log(new Status(level, Activator.PLUGIN_ID, message));
	}
}
